package br.com.vti.leilao.model.util;

import java.lang.reflect.ParameterizedType;

/**
 *
 * @author ednardo_ignacio
 */
public class ClassUtil {
    
    @SuppressWarnings("unchecked")
    public static Class<?> getTypeArguments(Class<?> classe, int pos) {
        ParameterizedType type = (ParameterizedType) classe.getGenericSuperclass();
        Class<?> theType = (Class<?>) type.getActualTypeArguments()[pos];
        return theType;
    }
    
}
